<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>会员登录</title>
    <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
    <script src="js/jquery-1.11.3.min.js" type="text/javascript"></script>
    <script src="js/bootstrap.min.js" type="text/javascript"></script>
    <script src="js/jquery.cookie.js" type="text/javascript"></script>
    <!-- 引入自定义css文件 style.css -->
    <link rel="stylesheet" href="css/style.css" type="text/css">

    <style>
        body {
            margin-top: 20px;
            margin: 0 auto;
            width: 100%;
        }

        .carousel-inner .item img {
            width: 100%;
            height: 300px;
        }
    </style>

    <script type="text/javascript">
        var page = 1;
        $(function () {
            showList();
        })

        function toPage(pageNum) {
            page = pageNum;
            showList();
        }

        function orderInfo(pid) {
            localStorage.setItem("pid", pid);
            location.href = "product.html";
        }

        function getList(result) {
            let total = result.meta.total / 6;
            var pageHtml = "";
            var date = "";
            if (result.data != null) {
                for (var i = 0; i < result.data.length; i++) {
                    date = date + "<div class=\"col-md-2\">" +
                        "<a href='javascript:void' onclick='orderInfo("+result.data[i].pid+")'>" +
                        "<img src=\"" + result.data[i].pimage + "\" onclick=\"imgClick(this)\"" +
                        " width=\"170\" height=\"170\" style=\"display: inline-block;\"></a><p>" +
                        "<a href=\"product.html\" style=\"color:green;\">\n" +
                        result.data[i].pname + "</a></p><p><font id=\"productPrice1\"" +
                        " color=\"#FF0000\">商城价：" + result.data[i].shopPrice + "</font></p></div>";
                }
            }
            $("#Product").html(date);
            if (page > 1) {
                pageHtml += "<li><a href='javascript:void' onclick='toPage(page-1)'><span>«</span></a></li>";
            }
            if (page > 2) {
                pageHtml += "<li><a href='javascript:void' onclick='toPage(page-2)'><span>" + (page - 2) + "</span></a></li>";
            }
            if (page > 1) {
                pageHtml += "<li><a href='javascript:void' onclick='toPage(page-1)'><span>" + (page - 1) + "</span></a></li>" ;
            }
            pageHtml += "<li>\<a><span>" + page + "</span></a></li>";
            if (page < total) {
                pageHtml += "<li><a href='javascript:void' onclick='toPage(page+1)'><span>" + (page + 1) + "</span></a></li>";
            }
            if (page < total - 1) {
                pageHtml += "<li><a href='javascript:void' onclick='toPage(page+2)'><span>" + (page + 2) + "</span></a></li>";
            }
            if (page < total) {
                pageHtml += "<li><a href='javascript:void' onclick='toPage(page+1)'><span>»</span></a></li>";
            }
            $("#page").html(pageHtml);
        }

        function showList() {
            $.ajax({
                url: "showList.action",
                type: "get",
                dataType: "json",
                data: {pageNum: page},
                success: function (result) {
                    getList(result);
                    if(result.meta.status>500) {
                        location.href = "error.html";
                        localStorage.setItem("msg",result.meta.msg)
                    }
                }
            });
        }

        function showListByCondition() {
            $.ajax({
                url: "showListByCondition.action",
                type: "get",
                dataType: "json",
                data: {
                    pageNum: page,
                    pname: $("#pname").val()
                },
                success: function (result) {
                    getList(result);
                    if(result.meta.status>500) {
                        location.href = "error.html";
                        localStorage.setItem("msg",result.meta.msg)
                    }
                }
            });
        }
    </script>
</head>

<body>
<!--
        描述：导航条
    -->

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<!--
        描述：菜单栏
    -->
<div class="container-fluid">
    <div class="col-md-4">
        <img src="img/logo3.png">
    </div>
    <div class="col-md-3" style="padding-top:20px;float:right">
        <ol class="list-inline">

            <li>欢迎您：admin</li>
            <li>
                <a href="/store/login?methodName=logout">退出</a>
            </li>
            <li>
                <a href="orderInfo.html">我的订单</a>
            </li>

            <li>
                <a href="cart.html">购物车</a>
            </li>
        </ol>
    </div>
</div>
<!--
        描述：导航条123 1234 123456
    -->
<div class="container-fluid">
    <nav class="navbar navbar-inverse">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.html">首页</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav" id="clist">
                    <li>
                        <a href="list.html">手机数码</a>
                    </li>
                    <li>
                        <a href="list.html">电脑办公</a>
                    </li>
                    <li>
                        <a href="list.html">家具家居</a>
                    </li>
                    <li>
                        <a href="list.html">鞋靴箱包</a>
                    </li>
                    <li>
                        <a href="list.html">图书音像</a>
                    </li>
                    <li>
                        <a href="list.html">母婴孕婴</a>
                    </li>
                    <li>
                        <a href="list.html">汽车用品</a>
                    </li>
                    <li>
                        <a href="list.html">运动户外</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
</div>

<script type="text/javascript">
</script>

<div style="float:right">
    <input type="text" id="pname" name="productName" placeholder="按名称搜索">
    <!-- 搜索按钮 -->
    <button class="btn btn-primary btn-sm" onclick="showListByCondition()">
        <span class="glyphicon glyphicon-search"></span> 搜 索
    </button>
</div>
<div class="row" style="width:1210px;margin:0 auto; margin-top: 40px" id="Product">
</div>

<!--分页 -->
<div style="width:380px;margin:0 auto;margin-top:50px;">
    <ul class="pagination" style="text-align:center; margin-top:10px;" id="page">
    </ul>
</div>
<!-- 分页结束=======================        -->

<!--
       商品浏览记录:
-->
<div style="width:1210px;margin:0 auto; padding: 0 9px;border: 1px solid #ddd;border-top: 2px solid #999;height: 246px;">

    <!--			<h4 style="width: 50%;float: left;font: 14px/30px " 微软雅黑="" ";"="">浏览记录</h4>-->
    <div id="divTest" style="margin: 30px;margin-bottom: 0px; float:left;"><img src="products/1/c_0023.jpg" width="150"
                                                                                height="150"/><img
            src="products/1/c_0050.jpg" width="150" height="150"/><img src="products/1/c_0016.jpg" width="150"
                                                                       height="150"/><img src="products/1/c_0003.jpg"
                                                                                          width="150" height="150"/><img
            src="products/1/c_0004.jpg" width="150" height="150"/><img src="products/1/c_0006.jpg" width="150"
                                                                       height="150"/></div>
</div>
<div style="text-align: center;margin-top: 5px;">
    <ul class="list-inline">
        <li>
            <a href="http://www.feicuiedu.cn/" target="_blank">关于我们</a>
        </li>
        <li>
            <a href="http://www.feicuiedu.cn/" target="_blank">联系我们</a>
        </li>
        <li>
            <a>招贤纳士</a>
        </li>
        <li>
            <a>法律声明</a>
        </li>
        <li>
            <a>友情链接</a>
        </li>
        <li>
            <a target="_blank">支付方式</a>
        </li>
        <li>
            <a target="_blank">配送方式</a>
        </li>
        <li>
            <a>服务声明</a>
        </li>
        <li>
            <a>广告声明</a>
        </li>
    </ul>
</div>
<div style="text-align: center;margin-top: 5px;margin-bottom:20px;">
    Copyright © 2018-2019 科技 版权所有
</div>

<script type="text/javascript">

</script>
</body>

</html>
<SCRIPT Language=VBScript><!--

//-->
</SCRIPT>